from datetime import date
from pydantic import BaseModel, Field
from typing import Optional


class ClinicCheckReport(BaseModel):
    chiefComplaint: str = Field(..., title="主诉", description="患者此次就诊的主要不适或症状")
    findings: str = Field(..., title="检查所见", description="体格检查或辅助检查的发现")
    diagnosis: str = Field(..., title="诊断", description="医生对本次情况的诊断")
    advice: str = Field(..., title="医嘱", description="治疗建议或复诊安排")



class ConsultationBase(BaseModel):
    doctor_ID: int
    patient_ID: int
    con_date: date
    result: ClinicCheckReport


class ConsultationCreate(ConsultationBase):
    pass

class ConsultationUpdate(BaseModel):
    doctor_ID: Optional[int] = None
    patient_ID: Optional[int] = None
    con_date: Optional[date] = None
    result: Optional[ClinicCheckReport] = None



class ConsultationResponse(ConsultationBase):
    ID: int

    class Config:
        from_attributes = True